﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FDEE.Model
{

    /// <summary>
    /// I梁预制板基类
    /// </summary>
    public abstract class PlateBase : MemberBase
    {
        public int Width, Length, Thickness; // 总宽度(横向)，总长度（纵向）
        public eSubType pType;
        public bool HasHole;

        /// <summary>
        /// 预制板构造函数
        /// </summary>
        /// <param name="typeName"></param>
        /// <param name="pierNumber"></param>
        /// <param name="width">横向跨度（梁间距）</param>
        /// <param name="type">ABC三类</param>
        /// <param name="hasHole">是否有孔</param>
        /// <exception cref="ArgumentException"></exception>
        protected PlateBase(string typeName, string pierNumber, int width, eSubType type, bool hasHole)
            : base(typeName, pierNumber)
        {
            HasHole = hasHole;
            Width = width;
            pType = type;
            Length = 0;
            Thickness = 90;
            switch (type)
            {
                case eSubType.A:
                    Length = 1200;
                    break;
                case eSubType.B:
                    Length = 700;
                    break;
                case eSubType.C:
                    Length = 500;
                    break;
                default:
                    throw new ArgumentException("无此类别");
            }

        }

        public override void SetConcreteClass()
        {
            //ConcreteClass = eConcreteClass.C45;
            ConcreteClass = eConcreteClass.C35;
        }

        public override void SetConcreteVolume()
        {
            ConcreteVolumn = Math.Round(Width * 0.001 * Length * 0.001 * Thickness * 0.001, 3, MidpointRounding.AwayFromZero);
        }

    }
}
